 {include file="public/header" /}
 <main class="thinkask-main">
     
    <div class="container">
      <div class="row">
        <section class="col-lg-9">
            <article class="page page-default  article-detail">
                <header class="page-heading">
                  <h1 class="title"><span style="border: 1px solid #00AAEE;border-radius:3px;padding: 1px 4px;font-size: 16px;color: #00AAEE;">问</span> {$question_content}</h1>
                  <div class="info clearfix">
                    <ul>
                      <li><i class="user"></i><span>{$user_name}</span></li>
                      <li><i class="time"></i><time>{:date_friendly($add_time,604800,'Y-m-d')} </time></li>
                      <li><i cite="views"></i><span class="views"></span></li>
                      <li><i cite="comment-count"></i><span class="comment-count"></span></li>
                    </ul>
                    <ul class="tags">
                    	{volist name="topic" id="v"}
                        <li><a href="topic/{$v.topic_id}" class="text">{$v.topic_title}</a></li>
                      {/volist}
                    </ul>
                    <?php if ($permission ){ ?>
                    <div class="pull-right" style="margin-top: -5px;margin-left: 10px;">
                         <button href="" data-toggle="dropdown" aria-expanded="false" data-hover="dropdown" class="btn btn-danger btn-sm dropdown-toggle">管理<span class="caret"></span></button>
                    
                        <ul class="dropdown-menu" role="menu">
                             <li class="hidden-xs"><a href="/question/post/edit/id/{$question_id}.html"><i class="icon icon-job"></i> 修改</a></li>
                             <li class="hidden-xs"><a href="/admin/index/index.html"><i class="icon icon-job"></i> 删除</a></li>
                             <!-- <li class="hidden-xs"><a href="/admin/index/index.html"><i class="icon icon-job"></i> 编辑</a></li> -->
                        </ul>
                    </div>
                      <?php }?>
				    	<?php if($focus){?>
                    <div class="btn-group pull-right" style="margin-top: -5px;">
                        <button href="javascript:void(0)" id="focusBtn" class="btn btn-info btn-sm">
                        <?php if($focus==1){?>
                            已关注
                            <?php }else{?>
                            关注
                            <?php }?>
                        </button>
                      <button href="" class="btn btn-success btn-sm">收藏</button>
                    </div>
				  	<?php }?>
                  </div>
                </header>
            
                <div class="page-body space">
                   <div class="article-detail-content">
                    {:e($question_detail)}
                   </div>
                </div>
            </article>
              <section class="thinkask-answer">
                <div class="answer-heading">
                  <h3 class="title">回复 <span class="num badge">{:count($answer)}</span></h3>
                </div>
                <div class="answer-body">
                  <!-- <div class="answer-list">
                    <div class="answer-user">
                      <a href="" class="avatar">
                        <img src="/uploads/avatar/000/00/00/01_avatar_min.jpg"/>
                      </a>
                    </div>
                    <div class="answer-content">
                        <p class="answer-info"><a href="">RobinTang</a>  4 分钟前回答</p>
                        <div class="content">
                          python 字典组成的列表如何搜索 ?python 字典组成的列表如何搜索 ?python 字典组成的列表如何搜索 ?python 字典组成的列表如何搜索 ?python 字典组成的列表如何搜索 ?
                        </div>
                    </div>
                            <section class="answer-list sub-list">
                              <div class="answer-user">
                                <a href="" class="avatar">
                                  <img src="/uploads/avatar/000/00/00/01_avatar_min.jpg"/>
                                </a>
                              </div>
                              <div class="answer-content">
                                  <p class="answer-info"><a href="">RobinTang</a>  4 分钟前回答</p>
                                  <div class="content">
                                    python 字典组成的列表如何搜索 ?python 字典组成的列表如何搜索 ?python 字典组成的列表如何搜索 ?python 字典组成的列表如何搜索 ?python 字典组成的列表如何搜索 ?
                                  </div>
                              </div>
                            </section>
                             <section class="answer-list sub-list">
                              <div class="answer-user">
                                <a href="" class="avatar">
                                  <img src="/uploads/avatar/000/00/00/01_avatar_min.jpg"/>
                                </a>
                              </div>
                              <div class="answer-content">
                                  <p class="answer-info"><a href="">RobinTang</a>  4 分钟前回答</p>
                                  <div class="content">
                                    python 字典组成的列表如何搜索 ?python 字典组成的列表如何搜索 ?python 字典组成的列表如何搜索 ?python 字典组成的列表如何搜索 ?python 字典组成的列表如何搜索 ?
                                  </div>
                              </div>
                            </section>
                  </div> -->
                  {volist name="$answer" id="v"}
                  <div class="answer-list">
                    <div class="answer-user">
                      <a href="javascript:;" class="avatar">
                        <img src="{$v.avatar_file}"/>
                      </a>
                    </div>
                    <div class="answer-content">
                        <p class="answer-info"><a href="">{$v.user_name}</a>  {:date_friendly($v['time'])}</p>
                        <div class="content">
                        {:e($v.message)}
                        </div>
                    </div>
                  </div>
                  {/volist}
                </div>
              </section>
			<?php if($focus){?>  
            <section>
	       <form action="{:url('question/ajax/comment')}" class="form-horizontal comment_form cmzForm" method="post">
			    <input class="hide" id="questionID" name="question_id" value="{$question_id}" />
              <div class="col-md-10">
                  <script type="text/javascript" src="/static/system/third/js/ueditor/ueditor.config.js"></script>
                  <script type="text/javascript" src="/static/system/third/js/ueditor/ueditor.all.js"></script>
                  <script type="text/javascript" src="/static/system/third/js/ueditor/ueditor.parse.js"></script>
                  <textarea name="message" class="message-baiduedit"  style="display:none;"></textarea>
                   <script id="message" type="text/plain" style="height:100px"></script>
                  <script type="text/javascript">
                      // var ue = UE.getEditor("message");
                      var ue = UE.getEditor('message', {
                              toolbars: [
                                            // ['fullscreen', 'source', 'undo', 'redo'],
                                            [

                                            // 'bold', //加粗
                                             // 'italic', //斜
                                             // 'underline', //下划线
                                             // 'fontborder', 
                                             // 'strikethrough',  //删除线
                                              // 'customstyle', //插入标题
                                              'blockquote',//引用
                                              // 'insertorderedlist', //有序列表
                                              // 'insertunorderedlist', //无序列表
                                              'link', //超链接
                                              'simpleupload', //单图上传
                                              'insertimage', //多图上传
                                              'insertvideo', //视频
                                              'removeformat', //清除格式

                                            ]
                                        ],
                              theme:'thinkask',
                              themePath:'/static/system/ueditorPlug/',
                              focus:true,//初始化时，是否让编辑器获得焦点true或false
                              // initialFrameHeight:100,
                              
                            });
                      ue.addListener( "selectionchange", function () {
                          $(".message-baiduedit").val(ue.getContent())
                         
                      } );
                      
                 </script>
              </div>
              <div class="col-lg-10">
                <a onclick="javascript:void(0)"  class="btn btn-primary pull-right cmzPost">回答</a>
              </div>

        </form>  
		</section>
		<?php }else{?>
		<div class="alert alert-info" role="alert">
			查看详细的回答内容请 <a href="/ucenter/user/login.html">登录</a> 
		</div>
		<?php }?>
        </section>
        <aside class="col-lg-3">
          <section class="box">
              <div class="box-heading">
                <h3>相关问题</h3>
              </div>
              <div class="box-body">
                <ul class="list-unstyled">
                <?php foreach ($aboutquestion as $key => $v): ?>
                  <li><a target="_blank" href="{$v.question_id}">{$v.question_content}</a></li>
                   <?php endforeach ?>
                </ul>
              </div>
            </section>
        </aside>
        

      </div>
    </div>
</main>
{include file="public/footer" /}